﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Reflection;
using System.Text;
using ByteSite.DBUtility;
using ByteSite.Common;
using SqlSugar;

namespace ByteSite.DAL
{
    /// <summary>
    /// 数据访问类:站点管理
    /// </summary>
    public partial class sites
    {
        public SqlSugarClient db;
        public sites()
        {
            db = new DBUtility.DbContext().Db;
        }


        /// <summary>
        /// 返回站点对应的导航ID
        /// </summary>
        public int GetSiteNavId(int id)
        {
            Entitys.dt_navigation model = db.Queryable<Entitys.dt_navigation, Entitys.dt_sites>((n, s) => new JoinQueryInfos(JoinType.Inner, n.name == "channel_" + s.build_path)).Where((n, s) => s.id == id).First();
            if (model == null)
                return 0;
            else
                return model.id;
        }

    }
}